<template>
  <div class="">
    <h1>精选专题列表</h1>
    <my-item
      v-for="item in list"
      :key="item.id"
      :item="item"
      @click="$router.push('/detail/' + item.id)"
    ></my-item>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
import { getList } from "../utils/yx";
import myItem from "../components/myItem.vue";
export default {
  setup(props, ctx) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const data = reactive({
      list: [],
    });
    getList().then((res) => {
      data.list = res.data;
    });

    return { ...toRefs(data) };
  },
  components: {
    myItem,
  },
};
</script>

<style lang="scss"></style>
